// These are meant to be typed into the REPL. You can also run
// scala -Xnojline < repl-session.scala to run them all at once.
/**
  * 13. 泛型类
  * 类和特质都可以带类型参数， 用方括号来定义类型参数，
  * 可以用类型参数来定义变量、方法参数和返回值。
  * 带有一个或多个类型参数的类是泛型的。
  */
class Pair[T, S](val first: T, val second: S) {
  override def toString = "(" + first + "," + second + ")"
}

val p = new Pair(42, "String")

val p2 = new Pair[Any, Any](42, "String")
